<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title></title>
	</head>
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<style type="text/css">
		* {
			margin: 0;
			padding: 0;
		}
		
		.warp {
			width: 100%;
			height: 7.5rem;
			background: url(img/bgimg.png) no-repeat;
			position: relative;
		}
		
		.logo {
			position: absolute;
			left: 50%;
			top: 1.02rem;
			margin-left: -1rem;
		}
		
		.logo img {
			width: 1.96rem;
			height: 0.58rem;
		}
		
		.money_img {
			width: 1.75rem;
			height: 1.75rem;
			background: #fff;
			border-radius: 50%;
			position: absolute;
			top: 2.07rem;
			left: 50%;
			margin-left: -0.9rem;
		}
		
		.money_img img {
			width: 1.23rem;
			height: 0.8rem;
			position: absolute;
			left: 50%;
			height: 50%;
			margin-left: -0.61rem;
			margin-top: 0.4rem;
		}
		
		.title {
			width: 100%;
			height: 2rem;
			margin: 0 auto;
			position: absolute;
			left: 0;
			top: 4.2rem;
		}
		
		.title img {
			width: 4.2rem;
			height: 0.44rem;
			margin-left: 15%;
		}
		
		.title p {
			text-align: center;
			color: #000;
			font-size: 0.24rem;
		}
		
		.title h3 {
			font-size: 0.5rem;
			text-align: center;
			font-weight: bolder;
			margin: 0.16rem 0 0.4rem 0;
		}
		
		.bg_img {
			position: absolute;
			top: 6.6rem;
		}
		
		.bg_img img {
			width: 100%;
			height: 2.1rem;
		}
		
		.phone {
			width: 5.54rem;
			height: 0.6rem;
			margin: 0 auto;
		}
		
		.phone input {
			width: 5.54rem;
			height: 0.6rem;
			text-align: center;
			margin-top: 1.5rem;
			font-size: 0.24rem;
		}
		
		.cunpon {
			width: 5.54rem;
			height: 0.6rem;
			text-align: center;
			background: #d2d2d2;
			margin: 0 auto;
			margin-top: 2rem;
			line-height: 0.6rem;
			color: #fff;
			margin-bottom: 0.5rem;
			font-size: 0.24rem;
		}
	</style>

	<body>
		<div class="warp">
			<div class="logo">
				<img src="img/logo.png" />
			</div>
			<div class="money_img">
				<img src="img/money.png" />
			</div>
			<div class="title">
				<p></p>
				<h3></h3>
				<img src="img/title.png" />
			</div>
			<div class="bg_img">
				<img src="img/img.png" />
			</div>
		</div>
		<div class="phone">
			<input type="" placeholder="输入手机号码接受邀请" name="" id="telephone" value="" />
		</div>
		<div class="cunpon">
			
		</div>
	</body>
	<script src="js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script type="text/javascript">
		$.ajax({
			type:"get",
			url:"http://bbs.tl178.cn/sha_Set",
			async:true,
			success:function(data){
			  var data = JSON.parse(data)
				$(".title p").html(data["list"]["title"])
				$(".title h3").html(data["list"]["gets"])
				$(".cunpon").html(data["list"]["button"])
			}
		});
		 function GetQueryString(name){
				     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
				     var r = window.location.search.substr(1).match(reg);
				     if(r!=null)return  unescape(r[2]); return null;
		}
		var time = GetQueryString("time")
		var a = GetQueryString("a")
		var c = GetQueryString("c")
		var d = GetQueryString("d")
		var code = GetQueryString("code")
		var fic = GetQueryString("fic")
		var state = GetQueryString("state")
		var time = GetQueryString("time")
	
				$('#telephone').bind('input propertychange', function() { 
				 //进行相关操作 
				  var userphone = $("#telephone").val();
				  var reg = new RegExp(/^1[34578]\d{9}$/);
					if(reg.test(userphone) && userphone.length == 11) {
						$(".cunpon").css("pointer-events", "auto").css("background","#000")
						$(".cunpon").click(function(){
							$.ajax({
								type:"post",
								url:"http://bbs.tl178.cn/us_sha",
								async:true,
								data:{
									invite_time:Date.parse(new Date())/1000,
									time:time,
									code:code,
									state:state,
									a:a,
									c:c,
									d:d,
									fic:fic,
									phone:userphone
								},
								success:function(data){
									var data = JSON.parse(data)
									
									if(data["status"]==0){
										alert(data["message"])
									}
									if(data["status"]==1){
										alert(data["message"])
										setTimeout(function(){
											window.location.href = "http://app.tl178.cn/weixinshare/share2.html?a="+a+"&c="+c+"&d="+d+"&code="+code+"&fic="+fic+"&state="+state+"&time="+time+""
										},3000)
									}
								}
							});
						})
					}else{
						$(".cunpon").css("pointer-events", "none").css("background","#d2d2d2")
					}
				});
	</script>
</html>